<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ page isELIgnored="false" %>

<%
    String path = request.getContextPath();
%>
<jsp:include page="/admin/inc/incHead.jsp" flush="false"/>
<script>
    function checkSearch() {
        if (document.formAdd.searchInfo.value.length < 1) {
            alert("请输入搜索关键字");
            document.formAdd.searchInfo.focus();
            return;
        }
        document.formAdd.submit();
    }
</script>
<form action="<%=path %>/user/userSearch.action" name="formAdd" method="post">
    <table class="table-bordered table">
        <tr bgcolor="#EEF4EA">
            <td colspan="3" class='title'><span>用户搜索</span></td>
        </tr>
        <tr align='center'>
            <td width="25%" align="right">
                搜索类别：
            </td>
            <td width="75%" align="left">
                <select name="searchType">
                    <option value="0">用户名</option>
                    <option value="1">邮箱</option>
                    <option value="2">电话</option>
                    <option value="3">真实姓名</option>
                    <option value="4">QQ</option>
                </select>
            </td>
        </tr>
        <tr align='center'>
            <td width="25%" align="right">
                信息：
            </td>
            <td width="75%" align="left">
                <input type="text" name="searchInfo" size="20"/>
            </td>
        </tr>
        <tr align='center'>
            <td width="25%" align="right">
                &nbsp;
            </td>
            <td width="75%" align="left">
                <input type="button" class="btn btn-info" onclick="checkSearch()" value="搜索"/>
            </td>
        </tr>
    </table>
</form>
<table width="100%" class="table table-bordered" style="background-color: #f4f4f4">
    <tr bgcolor="#E7E7E7">
        <td height="14" colspan="10" background="<%=path %>/img/tbg.gif">&nbsp;注册用户维护&nbsp;</td>
    </tr>
    <tr align="center" bgcolor="#FAFAF1" height="22">
        <td width="5%">ID</td>
        <td width="10%">用户名</td>
        <td width="10%">真实姓名</td>
        <td width="5%">性别</td>
        <td width="15%">联系方式</td>
        <td width="15%">E-mail</td>
        <td width="10%">QQ</td>
        <td width="10%">操作</td>
    </tr>
    <s:iterator value="#request.userList" var="user">
        <tr align='center' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='red';"
            onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
            <td bgcolor="#FFFFFF" align="center">
                <s:property value="#user.userId"/>
            </td>
            <td bgcolor="#FFFFFF" align="center">
                <s:property value="#user.userName"/>
            </td>
            <td bgcolor="#FFFFFF" align="center">
                <s:property value="#user.userRealName"/>
            </td>
            <td bgcolor="#FFFFFF" align="center">
                <s:if test="#user.userSex==0">男</s:if>
                <s:if test="#user.userSex==1">女</s:if>
                <s:if test="#user.userSex>1">其他</s:if>
            </td>
            <td bgcolor="#FFFFFF" align="center">
                <s:property value="#user.userTel"/>
            </td>
            <td bgcolor="#FFFFFF" align="center">
                <s:property value="#user.userEmail"/>
            </td>
            <td bgcolor="#FFFFFF" align="center">
                <s:property value="#user.userQq"/>
            </td>
            <td bgcolor="#FFFFFF" align="center">
                <a href="/user/userEditPage.action?userId=${user.userId}">修改</a>
                <a href="#" onclick="userDel(${user.userId})" class="pn-loperator">删除</a>
            </td>
        </tr>
    </s:iterator>
</table>
<jsp:include page="/common/page.jsp" flush="true"/>
<jsp:include page="/admin/inc/incFoot.jsp" flush="false"/>
